# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 217
n 217(None)[]:
	i: 154(AL), 216()
	o: 

nname: 216
n 216(None)[]:
	i: 194(AF), 201()
	o: 217()

nname: 201
n 201(None)[for but in buttons:
]:
	i: 194(for)
	o: 216()

nname: 194
n 194(None)[]:
	i: 154(loop)
	o: 201(for), 216(AF)

nname: 154
n 154(None)[ConfirmWindow.__init__(self, text=ip, buttons=buttons, confirm_action=confirm_action, confirm_args=confirm_args)
]:
	i: 87(), 153()
	o: 194(loop), 217(AL)

nname: 153
n 153(None)[]:
	i: 72(t)
	o: 154()

nname: 87
n 87(None)[buttons[1].connect(self.hide)
]:
	i: 72(f)
	o: 154()

nname: 72
n 72(buttons)[del _[1]
for self.modifiable_buttons in ip.split('.', 3):
]:
	i: 0(AF), 35()
	o: 87(f), 153(t)

nname: 35
n 35(None)[for digit in ip.split('.', 3):
]:
	i: 0(for)
	o: 72()

nname: 0
n 0(None)[self.title = title
]:
	i: 
	o: 35(for), 72(AF)

nname: 216
n 216(None)[]:
	i: 194()
	o: 

nname: 194
n 194(None)[for but in buttons:
	pass]:
	i: 72(loop)
	o: 216()

nname: 72
n 72(None)[del _[1]
for self.modifiable_buttons in ip.split('.', 3):
if not buttons:
	buttons[1].connect(self.hide)
ConfirmWindow.__init__(self, text=ip, buttons=buttons, confirm_action=confirm_action, confirm_args=confirm_args)
]:
	i: 0(AF), 35()
	o: 194(loop)

nname: 35
n 35(None)[for digit in ip.split('.', 3):
]:
	i: 0(for)
	o: 72()

nname: 0
n 0(None)[self.title = title
]:
	i: 
	o: 35(for), 72(AF)

nname: 216
n 216(None)[]:
	i: 72()
	o: 

nname: 72
n 72(None)[del _[1]
for self.modifiable_buttons in ip.split('.', 3):
if not buttons:
	buttons[1].connect(self.hide)
ConfirmWindow.__init__(self, text=ip, buttons=buttons, confirm_action=confirm_action, confirm_args=confirm_args)
for but in buttons:
	pass]:
	i: 0(AF), 35()
	o: 216()

nname: 35
n 35(None)[for digit in ip.split('.', 3):
]:
	i: 0(for)
	o: 72()

nname: 0
n 0(None)[self.title = title
]:
	i: 
	o: 35(for), 72(AF)

nname: 72
n 72(None)[del _[1]
for self.modifiable_buttons in ip.split('.', 3):
if not buttons:
	buttons[1].connect(self.hide)
ConfirmWindow.__init__(self, text=ip, buttons=buttons, confirm_action=confirm_action, confirm_args=confirm_args)
for but in buttons:
	pass]:
	i: 0(AF), 35()
	o: 

nname: 35
n 35(None)[for digit in ip.split('.', 3):
]:
	i: 0(for)
	o: 72()

nname: 0
n 0(None)[self.title = title
]:
	i: 
	o: 35(for), 72(AF)

self.nodes: {0: <unpyclib.structure.node instance at 0xb76a0d2c>, 35: <unpyclib.structure.node instance at 0xb76a0dac>, 72: <unpyclib.structure.node instance at 0xb76a0e0c>}
nname: 6
n 6(None)[__doc__ = 'IP address editor.'
type = 'ip'
def __init__(self, ip, title=_('IP address'), buttons=None, confirm_action=None, confirm_args=()):
	self.title = title

update = gui_updater()
]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb769dd4c>}
nname: 0
n 0(None)[self.val = val
self._max = max
self._min = min
self.cyclic = cyclic
Button.__init__(self, '%d' % self.val, selected)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76a08cc>}
nname: 64
n 64(None)[self.name = '%d' % self.val
]:
	i: 18(), 47(), 63()
	o: 

nname: 63
n 63(None)[]:
	i: 37(f)
	o: 64()

nname: 47
n 47(None)[self.val = self._min
]:
	i: 37(t)
	o: 64()

nname: 37
n 37(self.cyclic)[]:
	i: 0(f)
	o: 47(t), 63(f)

nname: 18
n 18(None)[self.val += 1
]:
	i: 0(t)
	o: 64()

nname: 0
n 0(self.val < self._max)[]:
	i: 
	o: 18(t), 37(f)

nname: 0
n 0(None)[if self.val < self._max:
	self.val += 1
else:
	if self.cyclic:
		self.val = self._min
self.name = '%d' % self.val
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76a0d8c>}
nname: 64
n 64(None)[self.name = '%d' % self.val
]:
	i: 18(), 47(), 63()
	o: 

nname: 63
n 63(None)[]:
	i: 37(f)
	o: 64()

nname: 47
n 47(None)[self.val = self._max
]:
	i: 37(t)
	o: 64()

nname: 37
n 37(self.cyclic)[]:
	i: 0(f)
	o: 47(t), 63(f)

nname: 18
n 18(None)[self.val -= 1
]:
	i: 0(t)
	o: 64()

nname: 0
n 0(self.val > self._min)[]:
	i: 
	o: 18(t), 37(f)

nname: 0
n 0(None)[if self.val > self._min:
	self.val -= 1
else:
	if self.cyclic:
		self.val = self._max
self.name = '%d' % self.val
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76a0f0c>}
nname: 60
n 60(None)[]:
	i: 27(), 59()
	o: 

nname: 59
n 59(None)[]:
	i: 0(f)
	o: 60()

nname: 27
n 27(None)[self.val = self._max
self.name = '%d' % self.val
]:
	i: 0(t)
	o: 60()

nname: 0
n 0(self.val > self._max)[self._max = val
]:
	i: 
	o: 27(t), 59(f)

nname: 0
n 0(None)[self._max = val
if self.val > self._max:
	self.val = self._max
	self.name = '%d' % self.val
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76a05ec>}
nname: 0
n 0(None)[return self._max
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76a02cc>}
nname: 0
n 0(None)[return self._max
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76a02ec>}
nname: 60
n 60(None)[]:
	i: 27(), 59()
	o: 

nname: 59
n 59(None)[]:
	i: 0(f)
	o: 60()

nname: 27
n 27(None)[self.val = self._min
self.name = '%d' % self.val
]:
	i: 0(t)
	o: 60()

nname: 0
n 0(self.val < self._min)[self._min = val
]:
	i: 
	o: 27(t), 59(f)

nname: 0
n 0(None)[self._min = val
if self.val < self._min:
	self.val = self._min
	self.name = '%d' % self.val
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76a058c>}
nname: 0
n 0(None)[return self._min
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76a020c>}
nname: 0
n 0(None)[return self._min
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76a02ac>}
nname: 6
n 6(None)[def __init__(self, val, selected=True, min=-1000000, max=100000, cyclic=False):
	self.val = val
	self._max = max
	self._min = min
	self.cyclic = cyclic
	Button.__init__(self, '%d' % self.val, selected)

def upper(self):
	if self.val < self._max:
		self.val += 1
	else:
		if self.cyclic:
			self.val = self._min
	self.name = '%d' % self.val

def lower(self):
	if self.val > self._min:
		self.val -= 1
	else:
		if self.cyclic:
			self.val = self._max
	self.name = '%d' % self.val

def set_max(self, val):
	self._max = val
	if self.val > self._max:
		self.val = self._max
		self.name = '%d' % self.val

max = property((lambda self: self._max), set_max)
def set_min(self, val):
	self._min = val
	if self.val < self._min:
		self.val = self._min
		self.name = '%d' % self.val

min = property((lambda self: self._min), set_min)
]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb769dcec>}
nname: 0
n 0(None)[from __future__ import absolute_import
from .confirmwindow import ConfirmWindow
from .core import gui_updater, Button
from pygui.eventmanager.windows import MultiIntegerButtonsEventHandler
class IpWindow(ConfirmWindow):
	__doc__ = 'IP address editor.'
	type = 'ip'
	def __init__(self, ip, title=_('IP address'), buttons=None, confirm_action=None, confirm_args=()):
		self.title = title

	update = gui_updater()


class IntegerButton(Button):
	def __init__(self, val, selected=True, min=-1000000, max=100000, cyclic=False):
		self.val = val
		self._max = max
		self._min = min
		self.cyclic = cyclic
		Button.__init__(self, '%d' % self.val, selected)

	def upper(self):
		if self.val < self._max:
			self.val += 1
		else:
			if self.cyclic:
				self.val = self._min
		self.name = '%d' % self.val

	def lower(self):
		if self.val > self._min:
			self.val -= 1
		else:
			if self.cyclic:
				self.val = self._max
		self.name = '%d' % self.val

	def set_max(self, val):
		self._max = val
		if self.val > self._max:
			self.val = self._max
			self.name = '%d' % self.val

	max = property((lambda self: self._max), set_max)
	def set_min(self, val):
		self._min = val
		if self.val < self._min:
			self.val = self._min
			self.name = '%d' % self.val

	min = property((lambda self: self._min), set_min)


]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7694e8c>}
from __future__ import absolute_import
from .confirmwindow import ConfirmWindow
from .core import gui_updater, Button
from pygui.eventmanager.windows import MultiIntegerButtonsEventHandler
class IpWindow(ConfirmWindow):
	__doc__ = 'IP address editor.'
	type = 'ip'
	def __init__(self, ip, title=_('IP address'), buttons=None, confirm_action=None, confirm_args=()):
		self.title = title

	update = gui_updater()


class IntegerButton(Button):
	def __init__(self, val, selected=True, min=-1000000, max=100000, cyclic=False):
		self.val = val
		self._max = max
		self._min = min
		self.cyclic = cyclic
		Button.__init__(self, '%d' % self.val, selected)

	def upper(self):
		if self.val < self._max:
			self.val += 1
		else:
			if self.cyclic:
				self.val = self._min
		self.name = '%d' % self.val

	def lower(self):
		if self.val > self._min:
			self.val -= 1
		else:
			if self.cyclic:
				self.val = self._max
		self.name = '%d' % self.val

	def set_max(self, val):
		self._max = val
		if self.val > self._max:
			self.val = self._max
			self.name = '%d' % self.val

	max = property((lambda self: self._max), set_max)
	def set_min(self, val):
		self._min = val
		if self.val < self._min:
			self.val = self._min
			self.name = '%d' % self.val

	min = property((lambda self: self._min), set_min)


